using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DevExpress.XtraNavBar;
using DevExpress.XtraBars;

namespace TX
{
    public partial class MainUI : DevExpress.XtraEditors.XtraForm
    {
        public MainUI()
        {
            InitializeComponent();
            			// Set up menu and navigation controls
			//RegisterModules();
			//Show the first module by default
            //if (ModuleInfoCollection.Instance.Count > 0)
            //    ModuleInfoCollection.ShowModule(ModuleInfoCollection.Instance[0], SCana.Panel2);
		}
		
		private void RegisterModules() {
            //ModuleInfoCollection.Add("ABelge", typeof(ABelge));
            //ModuleInfoCollection.Add("ARezervasyon", typeof(ARezervasyon));

            //foreach(CategoryInfo cInfo in CategoriesInfo.Instance) {
            //    // Add NavBar group
            //    NavBarGroup group = navBar.Groups.Add();
            //    // Set up the NavBar group caption
            //    group.Caption = cInfo.Name;
            //    // Set up the NavBar group large image index
            //    group.LargeImageIndex = cInfo.ImageIndex;
            //    // Tell to use small images for the NavBar Group items
            //    group.GroupStyle = NavBarGroupStyle.SmallIconsText;
            //    // Expand the group by default
            //    group.Expanded = true;
            //}
            //foreach(ModuleInfo mInfo in ModuleInfoCollection.Instance) {
            //    // Create NavBar item
            //    NavBarItem item = navBar.Items.Add();
            //    // Set up the NavBar item caption
            //    item.Caption = mInfo.Name;
            //    // Set up the Navbar item small image index
            //    item.SmallImageIndex = mInfo.ImageIndex;
            //    // Use the item tag property for module identification
            //    item.Tag = mInfo;
            //    // Add the NavBar item into the appropriate Navbar group
            //    navBar.Groups[mInfo.Category.Index].ItemLinks.Add(item);

            //    // Add a new item into bar list item
            //    this.barListItemModules.Strings.Add(mInfo.Name);
            //}
		}

        private void XtraForm1_Load(object sender, EventArgs e)
        {

            // //TODO: This line of code loads data into the 'StokDS.Vendor' table. You can move, or remove it, as needed.
            //VendorTableAdapter.Fill(DAL.StokDS.Vendor);
            //// TODO: This line of code loads data into the 'StokDS.BelgeTipi' table. You can move, or remove it, as needed.
            //BelgeTipiTableAdapter.Fill(DAL.StokDS.BelgeTipi);
            //// TODO: This line of code loads data into the 'StokDS.BelgeDetay' table. You can move, or remove it, as needed.
            //BelgeDetayTableAdapter.Fill(DAL.StokDS.BelgeDetay);
            //// TODO: This line of code loads data into the 'StokDS.Belge' table. You can move, or remove it, as needed.
            //BelgeTableAdapter.Fill(DAL.StokDS.Belge);

            
            //if (myArray[20] != System.DBNull.Value)	//FILLING_SP
            //    col.ColumnEdit = persistentRepository.Items[Int32.Parse(myArray[20].ToString()) - 1];

            ////MessageBox.Show(gridView1.Columns[2].Name);
            //gridControl1.ExternalRepository = persistentRepository1; 

            //gridView1.Columns[2].ColumnEdit = persistentRepository1.Items[0];
            //gridView1.Columns["DovizCinsiId"].ColumnEdit = persistentRepository1.Items["riCEDovizCinsi"];
            //gridView1.Columns["VendorId"].ColumnEdit = persistentRepository1.Items["riGLEVendor"];

            //RepositoryItemDateEdit riDateEdit = new RepositoryItemDateEdit();
            //// Customize the item...
            //// Add the item to the control's internal repository.
            //treeList1.RepositoryItems.Add(riDateEdit);
            //// Bind the item to the control's column.
            //treeList1.Columns["Start Date"].ColumnEdit = riDateEdit;

            xtraTabbedMdiManager1.MdiParent = this;
        }



        //// Change the module on navigation menu item click
        //private void mView_Click(object sender, System.EventArgs e)
        //{
        //    ModuleInfoCollection.ShowModule(ModuleInfoCollection.Instance[((MenuItem)sender).Text], pnlWorkingArea);
        //}
        //private void menuItem2_Click(object sender, System.EventArgs e)
        //{
        //    Close();
        //}

        
        private void NB_LinkClicked(object sender, NavBarLinkEventArgs e)
        {
            //ModuleInfo MI = null;
            //switch ((e.Link.Caption).ToLower())
            //{
            //    case "stok durumu":
            //        MI = ModuleInfoCollection.Instance["ABelge"];
            //        break;
            //    case "rezervasyon":
            //        MI = ModuleInfoCollection.Instance["ARezervasyon"];
            //        break;
            //};

            //if (MI != null)
            //    ModuleInfoCollection.ShowModule(MI, SCana.Panel2);


           
        }

 
        private void NBRezervasyon_LinkClicked(object sender, NavBarLinkEventArgs e)
        {
            switch ((e.Link.Caption).ToLower())
            {
                case "stok durumu":
                    WBelge wbelge = new WBelge();
                    //wbelge.MdiParent = this;// SCana.Panel2;
                    wbelge.Show();
                    break;
                case "rezervasyon":
                    ChildForm child = new ChildForm();
                    child.MdiParent = this;
                    child.Show();
                    //                    MI = ModuleInfoCollection.Instance["ARezervasyon"];
                    break;
            };

        }

        private void toolStripContainer1_ContentPanel_Load(object sender, EventArgs e)
        {

        }
    }
}